home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / shu194st.zoo / shellutils-1.9.4 / man / test.man < prev    next >
Encoding:
Text File  |  1994-03-16  |  4.4 KB  |  129 lines

  1.  
  2.  
  3.  
  4. TEST(1L)                         TEST(1L)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        test - check file types and compare values
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        t✓te✓es✓st✓t [expr]
  12.        t✓te✓es✓st✓t {--help,--version}
  13.  
  14. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  15.        This  manual page documents the GNU version of t✓te✓es✓st✓t.  Note
  16.        that most shells    have a built-in    command    by the same  name
  17.        and with    similar    functionality.
  18.  
  19.        t✓te✓es✓st✓t  returns  a    status of 0 (true) or 1    (false)    depending
  20.        on the evaluation  of  the  conditional    expression  _✓e_✓x_✓p_✓r.
  21.        Expressions may be unary    or binary.  Unary expressions are
  22.        often used to examine the status    of  a  file.   There  are
  23.        string operators    and numeric comparison operators as well.
  24.  
  25.        -✓-b✓b _✓f_✓i_✓l_✓e
  26.           True if _✓f_✓i_✓l_✓e exists and is block special.
  27.        -✓-c✓c _✓f_✓i_✓l_✓e
  28.           True if _✓f_✓i_✓l_✓e exists and is character special.
  29.        -✓-d✓d _✓f_✓i_✓l_✓e
  30.           True if _✓f_✓i_✓l_✓e exists and is a directory.
  31.        -✓-e✓e _✓f_✓i_✓l_✓e
  32.           True if _✓f_✓i_✓l_✓e exists
  33.        -✓-f✓f _✓f_✓i_✓l_✓e
  34.           True if _✓f_✓i_✓l_✓e exists and is a regular file.
  35.        -✓-g✓g _✓f_✓i_✓l_✓e
  36.           True if _✓f_✓i_✓l_✓e exists and is set-group-id.
  37.        -✓-k✓k _✓f_✓i_✓l_✓e
  38.           True if _✓f_✓i_✓l_✓e has its ``sticky'' bit set.
  39.        -✓-L✓L _✓f_✓i_✓l_✓e
  40.           True if _✓f_✓i_✓l_✓e exists and is a symbolic link.
  41.        -✓-p✓p _✓f_✓i_✓l_✓e
  42.           True if _✓f_✓i_✓l_✓e exists and is a named pipe.
  43.        -✓-r✓r _✓f_✓i_✓l_✓e
  44.           True if _✓f_✓i_✓l_✓e exists and is readable.
  45.        -✓-s✓s _✓f_✓i_✓l_✓e
  46.           True if _✓f_✓i_✓l_✓e exists and has  a  size  greater  than
  47.           zero.
  48.        -✓-S✓S _✓f_✓i_✓l_✓e
  49.           True if _✓f_✓i_✓l_✓e exists and is a socket.
  50.        -✓-t✓t [✓[_✓f_✓d]✓]
  51.           True if _✓f_✓d is opened on a    terminal.  If _✓f_✓d is omit-
  52.           ted, it defaults to 1 (standard output).
  53.        -✓-u✓u _✓f_✓i_✓l_✓e
  54.           True if _✓f_✓i_✓l_✓e exists and its set-user-id bit is set.
  55.        -✓-w✓w _✓f_✓i_✓l_✓e
  56.           True if _✓f_✓i_✓l_✓e exists and is writable.
  57.        -✓-x✓x _✓f_✓i_✓l_✓e
  58.           True if _✓f_✓i_✓l_✓e exists and is executable.
  59.        -✓-O✓O _✓f_✓i_✓l_✓e
  60.           True  if    _✓f_✓i_✓l_✓e exists and    is owned by the    effective
  61.  
  62.  
  63.  
  64. FSF               GNU Shell Utilities            1
  65.  
  66.  
  67.  
  68. TEST(1L)                         TEST(1L)
  69.  
  70.  
  71.           user id.
  72.        -✓-G✓G _✓f_✓i_✓l_✓e
  73.           True if _✓f_✓i_✓l_✓e exists and is owned by  the    effective
  74.           group id.
  75.        _✓f_✓i_✓l_✓e_✓1 -n✓nt✓t _✓f_✓i_✓l_✓e_✓2
  76.           True  if    _✓f_✓i_✓l_✓e_✓1 is newer (according to modification
  77.           date) than _✓f_✓i_✓l_✓e_✓2.
  78.        _✓f_✓i_✓l_✓e_✓1 -o✓ot✓t _✓f_✓i_✓l_✓e_✓2
  79.           True if _✓f_✓i_✓l_✓e_✓1 is older than file2.
  80.        _✓f_✓i_✓l_✓e_✓1 -✓-e✓ef✓f _✓f_✓i_✓l_✓e_✓2
  81.           True if _✓f_✓i_✓l_✓e_✓1 and    _✓f_✓i_✓l_✓e_✓2 have the    same  device  and
  82.           inode numbers.
  83.        -✓-z✓z _✓s_✓t_✓r_✓i_✓n_✓g
  84.           True if the length of _✓s_✓t_✓r_✓i_✓n_✓g is zero.
  85.        -✓-n✓n _✓s_✓t_✓r_✓i_✓n_✓g
  86.        _✓s_✓t_✓r_✓i_✓n_✓g True if the length of _✓s_✓t_✓r_✓i_✓n_✓g is non-zero.
  87.        _✓s_✓t_✓r_✓i_✓n_✓g_✓1 =✓= _✓s_✓t_✓r_✓i_✓n_✓g_✓2
  88.           True if the strings are equal.
  89.        _✓s_✓t_✓r_✓i_✓n_✓g_✓1 !✓!=✓= _✓s_✓t_✓r_✓i_✓n_✓g_✓2
  90.           True if the strings are not equal.
  91.        !✓! _✓e_✓x_✓p_✓r True if _✓e_✓x_✓p_✓r is false.
  92.        _✓e_✓x_✓p_✓r_✓1 -a✓a    _✓e_✓x_✓p_✓r_✓2
  93.           True if both _✓e_✓x_✓p_✓r_✓1 and _✓e_✓x_✓p_✓r_✓2 are true.
  94.        _✓e_✓x_✓p_✓r_✓1 -o✓o    _✓e_✓x_✓p_✓r_✓2
  95.           True if either _✓e_✓x_✓p_✓r_✓1 or _✓e_✓x_✓p_✓r_✓2 is true.
  96.        _✓a_✓r_✓g_✓1 O✓OP✓P _✓a_✓r_✓g_✓2
  97.           O✓OP✓P  is  one  of  -✓-e✓eq✓q,  -✓-n✓ne✓e,  -✓-l✓lt✓t,    -✓-l✓le✓e, -✓-g✓gt✓t, or -✓-g✓ge✓e.
  98.           These arithmetic binary operators     return     true  if
  99.           _✓a_✓r_✓g_✓1  is equal, not-equal, less-than, less-than-or-
  100.           equal, greater-than, or greater-than-or-equal  than
  101.           _✓a_✓r_✓g_✓2,  respectively.  _✓a_✓r_✓g_✓1 and _✓a_✓r_✓g_✓2 may be positive
  102.           integers,    negative integers, or the special expres-
  103.           sion  -✓-l✓l    _✓s_✓t_✓r_✓i_✓n_✓g,     which evaluates to the    length of
  104.           _✓s_✓t_✓r_✓i_✓n_✓g.
  105.    O✓OP✓PT✓TI✓IO✓ON✓NS✓S
  106.        When GNU    t✓te✓es✓st✓t is    invoked    with exactly  one  argument,  the
  107.        following options are recognized:
  108.        _✓-_✓-_✓h_✓e_✓l_✓p Print  a    usage message on standard output and exit
  109.           successfully.
  110.        _✓-_✓-_✓v_✓e_✓r_✓s_✓i_✓o_✓n
  111.           Print version information    on standard  output  then
  112.           exit successfully.
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. FSF               GNU Shell Utilities            2
  129.